If !owner_events, the pointer window has been usually set to NULL if
the pointer fell outside the grabbing widget, but it was not being
checked that the pointer_window is actually a child of the grab
window, in which case it should be obtained as if ungrabbed.
https://bugzilla.gnome.org/show_bug.cgi?id=735749
grab = _gdk_display_has_device_grab (display, device, serial);
if (grab != NULL &&
!grab->owner_events &&
- pointer_window != grab->window)
+ pointer_window != grab->window &&
+ !gdk_window_is_ancestor (pointer_window, grab->window))
pointer_window = NULL;
return pointer_window;